<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<f:view contentType="text/html" xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:s="http://jboss.com/products/seam/taglib">

	<html>
		<head>
			<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
			<title>#{messages['project']}</title>
			<link rel="shortcut icon" href="#{request.contextPath}/favicon.ico" />
			<a:loadStyle src="resource:///stylesheet/theme.xcss" />
			<a:loadStyle src="/stylesheet/theme.css" />
			<ui:insert name="head" />
		</head>

		<body>
			<div id="border-top" class="h_blue">
			  <div>
			    <div align="right" style="margin-right: 15px">
			        <span class="title"><h:outputText value="#{messages.tituloCabecalho}" /></span>				       
			    </div>
			  </div>
		    </div>
			
			<div class="body">
				
				<div class="perfil"> 
					
					<h1><h:outputText value="#{messages.cadastrarPerfil}" /></h1>
					
				    <h:messages id="messages" globalOnly="true" styleClass="message"
				        errorClass="errormsg" infoClass="infomsg" warnClass="warnmsg"
				        rendered="#{showGlobalMessages != 'false'}"/>
				
					<h:form id="perfilForm" enctype="multipart/form-data">
						
						<h:panelGrid columns="2">
						
							<rich:panel>
								<f:facet name="header">
									<h:outputText value="#{messages.informacoesPerfil}" />
								</f:facet>
					
								<s:decorate template="layout/edit.xhtml">
									<ui:define name="label">
										<h:outputText value="#{messages.nome}" />
									</ui:define>
					
									<h:inputText value="#{perfilCtrl.usuario.nome}" size="40" required="true" />
								</s:decorate>
					
								<s:decorate template="layout/edit.xhtml">
									<ui:define name="label">
										<h:outputText value="#{messages.email}" />
									</ui:define>
					
									<h:inputText value="#{perfilCtrl.usuario.email}" size="40" required="true" />
								</s:decorate>
					
								<s:decorate template="layout/edit.xhtml">
									<ui:define name="label">
										<h:outputText value="#{messages.login}" />
									</ui:define>
					
									<h:inputText value="#{perfilCtrl.usuario.login}" required="true" />
								</s:decorate>
					
								<s:decorate template="layout/edit.xhtml">
									<ui:define name="label">
										<h:outputText value="#{messages.senha}" />
									</ui:define>
					
									<h:inputSecret value="#{perfilCtrl.senha}" required="#{perfilCtrl.usuario.id == null}" />
								</s:decorate>
								
								<s:decorate template="layout/edit.xhtml">
									<ui:define name="label">
										<h:outputText value="#{messages.confirmarSenha}" />
									</ui:define>
					
									<h:inputSecret value="#{perfilCtrl.confirmarSenha}" required="#{perfilCtrl.usuario.id == null}" />
								</s:decorate>
					
								<s:decorate template="layout/edit.xhtml">
									<ui:define name="label">
										<h:outputText value="#{messages.imagemPerfil}" />
									</ui:define>
					
									<s:fileUpload data="#{perfilCtrl.usuario.imagem}" value="#{perfilCtrl.usuario.imagem}"
										accept="image/gif" />
								</s:decorate>
								
								<div style="clear: both;" />
								
							</rich:panel>
							
							<rich:simpleTogglePanel style="vertical-align: top;" switchType="client" height="178" width="210">
								<f:facet name="header">
									<h:outputText value="#{messages.tagsPerfil}" />
								</f:facet>
								<s:div style="height: 178px; width: 210px; text-align: center; font-size: 11px;">
									<h:panelGrid columns="1">
										<h:selectManyCheckbox style="font-size: 11px;" value="#{perfilCtrl.usuario.tagList}" layout="pageDirection">
											<s:selectItems var="tag" value="#{perfilCtrl.todasTags}" label="#{tag.id}" />
											<s:convertEntity />
										</h:selectManyCheckbox>
									</h:panelGrid>
								</s:div>
							</rich:simpleTogglePanel>
						
						</h:panelGrid>
						
						<s:div styleClass="actionButtons">
							<h:commandButton action="#{perfilCtrl.salvar}"
								value="#{messages.actionSave}" />
							<h:commandButton action="/home.xhtml"
								value="#{messages.actionCancelar}" immediate="true" />
						</s:div>
				
					</h:form>
			
				</div>
			
			</div>
			
			<div style="clear: both;" />
			
			<div id="border-bottom">
				<div>
					<div></div>
				</div>
			</div>
			
			<div style="clear: both;" />
			
			<div class="footer">
				<p>Projeto para a disciplina de Desenvolvimento de Software para Web.<br />
					Alunos: Leonardo Brasileiro, Bruno Garcia e Ítalo Coe.</p>
			</div>
			
		</body>
	
	</html>

</f:view>